<!doctype html>
<html lang="en">
<head>
    @include('web.layout.head')
    <link rel="stylesheet" href="{{asset('/css/web/user/points.css')}}">
    <script src="{{asset('/js/web/user/points.js')}}"></script>
</head>
<body>
@include('web.layout.header')
@include('web.layout.user_tab')
<div class="base_member_content">
    <div class="w1200">
        @include('web.layout.buyer_nav')
        <div class="nav_right flr">
            <div class="base_content">
                <div class="line_title">我的积分</div>
                <div class="pointsbox f-cb">
                    <div class="now fl">
                        <div class="tt">可用积分</div>
                        <div class="num"></div>
                    </div>
                    {{--
                    <div class="sign flr" data-url="{{asset('/buyer/sign_in')}}">
                        <a class="click jm_btn2">签到+1</a>
                    </div>
                    --}}
                </div>
                <div class="my-subnav f-cb">
                    <ul class="points_tab" data-url="{{asset('/user/points')}}" data-status="" data-time="">
                        <li>
                            <a href="" class="jm_hover">积分明细</a><i></i>
                        </li>
                        <li>
                            <a href="" class="jm_hover">积分收入</a><i></i>
                        </li>
                        <li>
                            <a href="" class="jm_hover">积分支出</a><i></i>
                        </li>
                    </ul>
                    <div class="select_rule">
                        <a href="##" class="rule flr">查看积分规则</a>
                        <select name="time" id="time_type" class="flr">
                            <option value="all" >全部积分记录</option>
                            <option value="year" >近一年积分记录</option>
                            <option value="month" >近一个月积分记录</option>
                            <option value="week" >近一周积分记录</option>
                        </select>
                    </div>
                </div>
                <div class="content">
                    <div class="table">
                        <table>
                            <thead>
                                <tr class="jm_letter">
                                    <td width="260" height="32">日期</td>
                                    <td width="260" height="32">收入/支出</td>
                                    <td width="450" height="32">详细说明</td>
                                </tr>
                            </thead>
                            <tbody>
                            @if(!empty($record_list))
                                @foreach($record_list as $record)
                                    <tr>
                                        <td width="260" height="32">{{$record['created_at']}}</td>
                                        <td width="260" height="32" class="num {{$record['type'] == 'add' ? 'positive' : 'negative'}}">
                                            @if($record['type'] == 'add')
                                                +¥{{$record['point']}}
                                            @elseif($record['type'] == 'reduce')
                                                -¥{{$record['point']}}
                                            @endif
                                        </td>
                                        <td width="450" height="32">
                                            @if($record['acquire_channel'] == 'sign_in')
                                                签到送积分
                                            @elseif($record['acquire_channel'] == 'top_up')
                                                充值送积分
                                            @elseif($record['acquire_channel'] == 'pay')
                                                支付送积分
                                            @elseif($record['acquire_channel'] == 'award')
                                                抽奖送积分
                                            @endif
                                        </td>
                                    </tr>
                                @endforeach
                            @endif
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
@include('web.layout.footer')
</body>
</html>